package com.ericsson.epc.modules.ebmAutoCollector.job;

import com.ericsson.common.quartz.job.MainJob;
import com.ericsson.common.quartz.job.ManualQuartzJob;
import com.ericsson.common.quartz.service.QuartzTableManager;
import com.ericsson.common.util.LogFileName;
import com.ericsson.common.util.LoggerUtils;
import com.ericsson.epc.modules.ebmAutoCollector.task.CreateEbmLogTask;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @description: 定时任务每天凌晨生成ebmlog
 * @author: wangjingshi
 * @create: 2021-02-22 10:52
 */
@Component
public class CreateEbmLogJob implements MainJob {

    private Logger log = LoggerUtils.Logger(LogFileName.CreateEbmLogJob);
    @Autowired
    private QuartzTableManager quartzTableManager;
    @Autowired
    private CreateEbmLogTask createEbmLogTask;
    @Value("${createEbmCron}")
    private String createEbmCron;

    @Override
    public void doTask() {
        log.info("===== do CreateEbmLogTask start =====:"+createEbmCron);
        quartzTableManager.addManualTaskJob("CreateEbmLogTask","CreateEbmLogTask",
                "CreateEbmLogTask","CreateEbmLogTask",
                ManualQuartzJob.class,createEbmCron,createEbmLogTask);

    }
}
